@extends('admin.public.header')
@section('title','售后订单详情')
<style>
    .orderProcess{
        margin-bottom: 1.5rem;
        width: 100%;
        height: 8rem;
        border: 1px solid #ECEEEF;
        position: relative;
        margin-left: 1.1rem;
        margin-right: 1.1rem;
    }

    table .orderProcess ul{
        padding-left: 1rem;
    }

    .orderWord{
        height: 3rem;
    }
    
    .over{
        color: green;
    }

    .noOver{
        color: #888888;
    }

    .orderProcess ul{
        list-style: none;
        position: absolute;
        top:50%;
        left: 50%;
        margin-top: -4rem;
        margin-left: -28rem;
        padding-left: 0;
    }
    ul li{
        float: left;
        text-align: center;
        width: 8rem;
    }

    .orderIcon .iconfont{
        font-size: 2rem;
    }

    li i{
        height: 3.8rem;
        line-height: 3.8rem;
    }

</style>
<link rel="stylesheet" href="https://at.alicdn.com/t/font_807230_b9igprrhpse.css" media="all">
@section('listcontent')
    <div class="layui-tab-content">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">订单信息</div>
                        <table class="layui-table">
                            <colgroup>
                                <col width="150">
                            </colgroup>
                            <tbody>
                            <tr>
                                <td>售后类型</td>
                                <td>{{ $info->refund_type }}</td>
                            </tr>
                            <tr>
                                <td>退款单号</td>
                                <td>{{ $info->order_refund_no }}</td>
                            </tr>
                            <tr>
                                <td>售后状态</td>
                                <td style="color:#1E9FFF">{{ $info->refund_status }}</td>
                            </tr>
                            <tr>
                                <td>下单用户</td>
                                <td>{{ $info->nickname }}</td>
                            </tr>
                            <tr>
                                <td>退款方式</td>
                                <td style="color:#1E9FFF">{{ $info->refund_pay_type }}</td>
                            </tr>
                            <tr>
                                <td>订单总金额（含运费）</td>
                                <td style="color:#FF5722">{{ $info->total_price }} 元</td>
                            </tr>
                            <tr>
                                <td>订单运费</td>
                                <td style="color:#FF5722">{{ $info->express_price }} 元</td>
                            </tr>
                            <tr>
                                <td>实际支付金额</td>
                                <td style="color:#FF5722">{{ $info->pay_price }} 元</td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="layui-card-header">退款详情</div>
                        <table class="layui-table">
                            <colgroup>
                                <col width="150">
                            </colgroup>
                            <tbody>
                            <tr>
                                <td>退款金额</td>
                                <td style="color:#FF5722">{{ $info->refund_price }} 元</td>
                            </tr>
                            <tr>
                                <td>退款说明</td>
                                <td style="color:#FF5722">{{ $info->user_desc }}</td>
                            </tr>
                            <tr>
                                <td>退款凭证</td>
                                <td>
                                @foreach($info->pic_list as $k => $v)
                                    <image style="width:80px;height:80px;display:block;float:left;" src="{{ $v }}">
                                @endforeach    
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">商品信息</div>
                        <table class="layui-table">
                            <colgroup>
                                <col width="150">
                            </colgroup>
                            <tbody>
                            @foreach($order_detail as $k => $v)
                            <tr>
                                <td>商品【{{ $k+1 }}】</td>
                                <td><image style="width:80px;height:80px;display:block;float:left;" src="{{ $v->goods_pic }}"><span style="margin-left:10px;">商品名称：{{ $v->goods_name }}<span><br/><span style="margin-left:10px;color:#1E9FFF">规格：{{ $v->goods_attr[0]['attr_group_name'] }} - {{ $v->goods_attr[0]['attr_name'] }}</span><br/><span style="margin-left:10px;">数量：{{ $v->goods_num }}</span><br/><span style="margin-left:10px;color:#FF5722;">小计：{{ $v->pay_price }} 元</span></td>
                                
                            </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
                
            </div>
        </div>   
    </div>

@endsection

@section('listscript')
    <script type="text/javascript">
    layui.use(['layer','form'], function () {
            var layer = layui.layer, form = layui.form, $=layui.jquery;

        form.on('submit(saveBtn)', function(data){
            var loading = layer.msg('加载中..', {icon: 16,shade: 0.3,time: false});
            $.ajax({
                url:'/admin/order/detail',
                type:'post',
                data:data.field,
                dataType:"JSON",
                headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
                success:function(res){
                    layer.close(loading);  //返回数据关闭loading
                    if(res.code == 0){
                        $("#saveBtn").removeClass("layui-btn-normal").addClass("layui-btn-disabled");
                        $("#saveBtn").attr("disabled","true");
                        layer.msg(res.message,{icon: 1},function(){
                            setTimeout('location.reload()',500);
                        });
                        
                    }
                    else{
                        layer.msg(res.message,{icon: 2});
                    }
                },
                error:function(e){
                    layer.msg("提交失败",{icon: 2});
                },
                
            });
            return false;
        });
    });
</script>
@endsection

